import axios from "../utils/request"
// 登录接口地址
export function login(data){
    return axios({
        method:'POST',
        url:'login',
        data
    })
}
//检验token 有效性
export function checkToken(token){
    return axios ({
        method:'GET',
        url:'checkToken',
        headers:{
            token:token
        }
    })
}
//新增用户接口
export function adduser(data){
    return axios({
        method:'POST',
        url:'adduser',
        data
    })
}
//编辑用户
export function editor(id){
    return axios({
        method:'POST',
        url:`editor/${id}`,
    })
}
//编辑用户信息 
export function editoruser(id,data){
    return axios({
        method:'POST',
        url:`editoruser/${id}`,
        data
    })
}
//列表页 分页数据获取
export function user(page,size){
    return axios({
        method:'POST',
        url:`getuser/${page}/${size}`
    })
}

//获取 所有用户的电话号码
export function getphone(){
    return axios({
        method:'GET',
        url:'getphone'
    })
}

//结账接口 提供电话号码 金额信息
export function rdc(data){
    return axios({
        method:'POST',
        url:'reduce',
        data
    })
}

//获取结账用户的信息
export function query(data){
    return axios({
        method:'POST',
        url:'query',
        data
    })
}
//加款接口
export function recharge(data){
    return axios({
        method:'POST',
        url:'recharge',
        data
    })
}
//根据id 查询消费记录
export function getconsume(id){
    return axios({
        method:'POST',
        url:`getconsume/${id}`
    })
}
//获取当日销售额
export function getday(){
    return axios({
        method:'POST',
        url:'getday'
    })
}

export function getmonth(){
    return axios({
        method:'POST',
        url:'getmonth'
    })
}